package cs5226.batchjob;

public class QueryUtil {

	public static final String DELETE_BASELINE = "{ call DBMS_WORKLOAD_REPOSITORY.drop_baseline (?) }";

	public static String CREATE_SNAPSHOT = "{ ?=call DBMS_WORKLOAD_REPOSITORY.create_snapshot() }";
	
	public static String CREATE_BASELINE = "{ call DBMS_WORKLOAD_REPOSITORY.create_baseline(?,?,?) }";

	public static String GET_METRIC = "SELECT METRIC_ID, METRIC_NAME,METRIC_UNIT, Avg(AVERAGE) Avg_value, Min(MINVAL) min_value, MAX(MAXVAL) max_value,MAX(END_TIME)  "
			+ "FROM  Dba_Hist_Sysmetric_Summary WHERE SNAP_ID  =? And Metric_Id in ('2114', '2000','2002','2001','2025') GROUP BY METRIC_ID, METRIC_NAME, METRIC_UNIT";

	public static String GET_REDOMETRIC = "SELECT EVENT_ID, EVENT_NAME,  AVG(TOTAL_WAITS) AVG_WAIT, AVG(TOTAL_TIMEOUTS) AVG_TIMEOUT FROM DBA_HIST_SYSTEM_EVENT  "
			+ "WHERE SNAP_ID = ? AND EVENT_NAME IN ('LOG FILE PARALLEL WRITE', 'LOG FILE SYNC',' LOG FILE SWITCH (CHECKPOINT INCOMPLETE)') GROUP BY EVENT_ID, EVENT_NAME ";

	public static String INSERT_METRIC = "INSERT INTO CS5226_METRIC_TABLE (SNAP_ID, METRIC_ID, METRIC_NAME, METRIC_UNIT, AVG_VALUE, MIN_VALUE, MAX_VALUE,AVG_TIMEOUTS, END_TIME) VALUES (?,?,?,?,?,?,?,?,?)";

}
